package com.xzq.action;

import java.io.UnsupportedEncodingException;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.xzq.biz.ProductBiz;
import com.xzq.entity.Page;
@Controller
public class ProductAction extends BaseAction {
	@Resource
	private ProductBiz biz;
	private Page page;
	private String likename;
	private Integer num;
	private int choose;
	
	
	public int getChoose() {
		return choose;
	}
	public void setChoose(int choose) {
		this.choose = choose;
	}
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	public String getLikename() {
		return likename;
	}
	public void setLikename(String likename) {
		this.likename = likename;
	}
	public Page getPage() {
		return page;
	}
	public void setPage(Page page) {
		this.page = page;
	}
	
	public String show(){
		String likename2 = null;
		if(likename==null){
			likename = "";
		}
		try {
			likename2 = new String(likename.getBytes("iso-8859-1"),"UTF-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		likename = likename2;
		num = 0;
		if(likename==null){
			likename = "";
		}
		if(!"".equals(likename)){
			num = 1;
		}
		page = biz.findLikeNameProduct(page, likename, choose);
		return "show";
	}
}
